package ai.people.netmon.framework.domain.graph.tags;

import ai.people.netmon.framework.domain.archives.annotation.CheckEmpty;
import ai.people.netmon.framework.domain.graph.BaseTag;
import ai.people.netmon.framework.domain.archives.vo.ArchivesVO;
import com.alibaba.fastjson.PropertyNamingStrategy;
import com.alibaba.fastjson.annotation.JSONType;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;

/**
 * 邮箱tag
 *
 * @author zhenglin
 * @date 2022/4/25
 */
@Data
@NoArgsConstructor
@JSONType(naming = PropertyNamingStrategy.SnakeCase)
public class EmailTag extends BaseTag {
    /**
     * 邮箱账号
     */
    @CheckEmpty(message = "邮箱账号不能为空")
    @NotBlank(message = "邮箱账号不能为空")
    private String email;
    /**
     * 密码
     */
    private String password;

    public EmailTag(ArchivesVO.SocialInfo.Email emailInfo) {
        this.email = emailInfo.getEmail();
        this.password = emailInfo.getPassword();
    }
}
